Skip to content

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Oct 2, 2025

Additional details

Adds 112 as a potential exit code when Cypress is run with POSIX complaint exit codes enabled (--posix-exit-codes). This exit code is used when --record or --parallel mode is unable to communicate with Cypress Cloud API due to network conditions.

Steps to test

How has the user experience changed?

PR Tasks


Note

When recording/parallel runs hit Cloud network errors with --posix-exit-codes, exit with code 112; add network-specific error types and make Cloud API timeouts configurable.

  • Runner/CLI:
    • Exit with code 112 for Cloud network failures in --record/--parallel when --posix-exit-codes is enabled; refactor startInMode and inline exitWithCode handling.
    • Adjust run-mode exits to respect POSIX codes and cancellation; add extra debug logs.
  • Errors & Schema:
    • Add CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK and CLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK to GraphQL schema and implement corresponding error templates and snapshots.
  • Cloud API:
    • Introduce defaultTimeout() (honors CYPRESS_INTERNAL_API_TIMEOUT) and use it across requests instead of a fixed 60s timeout.
  • Stability:
    • Tweak early-exit handling (EarlyExitTerminator.waitForEarlyExit signature).
  • Tests:
    • Add/expand integration and system tests covering new exit code 112, network error paths, grouping/parallel behaviors, and timeout scenarios.
  • Changelog:
    • Document new feature and related misc updates under 15.5.0.

Written by Cursor Bugbot for commit 65d7718. This will update automatically on new commits. Configure here.

Copy link

cypress bot commented Oct 2, 2025

cypress    Run #66432

Run Properties:  status check failed Failed #66432  •  git commit 65d77181e3: Merge branch 'develop' into feat-api-failure-exit-112
Project cypress
Branch Review feat-api-failure-exit-112
Run status status check failed Failed #66432
Run duration 16m 49s
Commit git commit 65d77181e3: Merge branch 'develop' into feat-api-failure-exit-112
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 705
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 761
View all changes introduced in this branch ↗︎
UI Coverage  0%
  Untested elements 4  
  Tested elements 0  
Accessibility  100%
  Failed rules  0 critical   0 serious   0 moderate   0 minor
  Failed elements 0  

Tests for review

Failed  cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio > updates an existing test with assertions Test Replay Screenshots
Flakiness  cypress/e2e/cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
Cypress In Cypress Origin Communicator > primary origin memory leak prevention > cleans up the primaryOriginCommunicator events when navigating away from the /specs to /runs Test Replay Screenshots

@cacieprins cacieprins marked this pull request as ready for review October 7, 2025 20:23
@cacieprins cacieprins marked this pull request as draft October 7, 2025 20:23
cursor[bot]

This comment was marked as outdated.

@cacieprins cacieprins marked this pull request as ready for review October 8, 2025 13:15
cursor[bot]

This comment was marked as outdated.

@cacieprins cacieprins requested a review from AtofStryker October 8, 2025 13:52
return require('./errors').logException(err)
.then(() => {
debug('calling exit 1')
await require('./errors').logException(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason we can just import errors at the top of the file since we are starting to move away from CJS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of how the integration tests are set up, this has to be dynamically required for now :(

break
}
case 'returnPkg': {
const pkg = await require('./modes/pkg')(options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just import pkg from '@packages/root' at the top of the file since its a bundled package now and just reference it here instead of ./modes/pkg? Would be much simpler

break
}
case 'info': {
await require('./modes/info')(options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just hoist this import or await import it? If not I'll likely get to this in the launcher refactor

})
})

it('errors and exits with 1 when posix exit codes are enabled', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the reason the posix tests are added here and not in the posix PR? Is there some type of integration between these two I am missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see its the differences between 112 vs 1 exit code

@@ -0,0 +1,8 @@
We encountered an unexpected error communicating with our servers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so much easier to diff now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It really really is!

@jennifer-shehane jennifer-shehane self-requested a review October 8, 2025 20:22
}
}

debug('calling exit 1')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove I believe

Comment on lines 14 to 15
import { getError, AllCypressErrorNames } from '@packages/errors'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { getError, AllCypressErrorNames } from '@packages/errors'
import { getError } from '@packages/errors'
import type { AllCypressErrorNames } from '@packages/errors'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 660ab1b

})
default:
return throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', {
throw throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not understanding why this would change to throw either.

@cacieprins cacieprins merged commit 86d9c84 into develop Oct 14, 2025
85 of 90 checks passed
@cacieprins cacieprins deleted the feat-api-failure-exit-112 branch October 14, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UX/CLI Improvement: Fatal Cy Cloud communication failure exits with a specific exit code

4 participants